package com.zide.generator.service.impl;

import com.zide.common.core.domain.PageResult;
import com.zide.common.core.text.Convert;
import com.zide.generator.entity.GenTableColumn;
import com.zide.generator.vo.GenTableColumnSearchVO;
import com.zide.generator.mapper.GenTableColumnMapper;
import com.zide.generator.service.GenTableColumnService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 业务字段 服务层实现
 *
 * @author zide
 */
@AllArgsConstructor
@Service
public class GenTableColumnServiceImpl implements GenTableColumnService {

    private final GenTableColumnMapper genTableColumnMapper;

    /**
     * 查询业务字段列表
     */
    @Override
    public PageResult<GenTableColumn> selectGenTableColumnListByTableId(GenTableColumnSearchVO searchVO) {

        return genTableColumnMapper.selectPage(searchVO);
    }

    /**
     * 新增业务字段
     *
     * @param genTableColumn 业务字段信息
     * @return 结果
     */
    @Override
    public int insertGenTableColumn(GenTableColumn genTableColumn) {
        return genTableColumnMapper.insertGenTableColumn(genTableColumn);
    }

    /**
     * 修改业务字段
     *
     * @param genTableColumn 业务字段信息
     * @return 结果
     */
    @Override
    public int updateGenTableColumn(GenTableColumn genTableColumn) {
        return genTableColumnMapper.updateGenTableColumn(genTableColumn);
    }

    /**
     * 删除业务字段对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteGenTableColumnByIds(String ids) {
        return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids));
    }
}
